/**
 * Demonstrates a range of Button options the framework offers out of the box
 */
Ext.define('cloud.view.category.CategoryAdd', {
    extend: 'Ext.form.FormPanel',
    xtype: 'categoryadd',
    config: {
        //style:'font-size:14px',
        title: '添加分类',
        items: [
            {
                xtype: 'toolbar',
                docked: 'bottom',
                layout: {
                    type: 'vbox',
                    pack: 'end'
                },
                items: [
                    {
                        id: 'category_submit',
                        iconMask: true,
                        scope: this,
                        cls: 'x-button2',
                        text: '提交',
                        style: 'float:right'
                    }
                ]
            },
            {
                xtype: 'fieldset',
                title: '新增分类',
                defaults: {
                    labelwidth: '20%',
                    xtype: 'textfield',
                    required: true,
                    clearIcon: true
                },


                items: [
                    {  id: 'category_name',
                        name: 'name',
                        label: '分类名称',
                        maxLength: 50,
                        placeHolder: '请输分类名称'
                    },
                    {   xtype: 'selectfield',
                        id: 'category_display',
                        name: 'display',
                        label: '请选择排序',
                        options: [
                            {text: '1', value: '1'},
                            {text: '2', value: '2'},
                            {text: '3', value: '3'},
                            {text: '4', value: '4'},
                            {text: '5', value: '5'},
                            {text: '6', value: '6'},
                            {text: '7', value: '7'},
                            {text: '8', value: '8'},
                            {text: '9', value: '9'},
                            {text: '10', value: '10'}
                        ]
                    },
                    {
                        xtype: 'togglefield',
                        name: 'enable',
                        value: 1,
                        label: '是否启用'
                    }
                ]
            },
            {
                layout: 'hbox',
                xtype: 'panel',
                style: 'margin:0 40px;',
                items: [
                    {
                        itemId: 'category_upload_icon',
                        xtype: 'fileupload',
                        width: '20%',
                        height: '10px',
                        autoUpload: true,
                        loadAsDataUrl: true,
                        states: {
                            browse: {
                                text: '上传分类icon'
                            },
                            ready: {
                                text: 'Load'
                            },

                            uploading: {
                                text: 'Loading',
                                loading: true
                            }
                        }
                    },

                    {
                        itemId: 'loadedImage',
                        xtype: 'img',
                        width: '80%',
                        height: '200px',
                        style: 'margin-top:15px;'
                    }
                ]
            }
        ]
    }
})
;